
{{extend ('./common/studentyalout.html')}}

{{#block("body")}}
<div class="main-container">
	<div class="padding-md">
		<h2 class="header-text">
			修改信息
		</h2>
		<div class="smart-widget m-top-lg widget-dark-blue">
			<div class="smart-widget-header">
				修改信息
				<span class="smart-widget-option">
								<span class="refresh-icon-animated">
									<i class="fa fa-circle-o-notch fa-spin"></i>
								</span>
	                            <a href="#" class="widget-toggle-hidden-option">
	                                <i class="fa fa-cog"></i>
	                            </a>
	                            <a href="#" class="widget-collapse-option" data-toggle="collapse">
	                                <i class="fa fa-chevron-up"></i>
	                            </a>
	                            <a href="#" class="widget-refresh-option">
	                                <i class="fa fa-refresh"></i>
	                            </a>
	                            <a href="#" class="widget-remove-option">
	                                <i class="fa fa-times"></i>
	                            </a>
	                        </span>
			</div>
			<div class="smart-widget-inner">
				<div class="smart-widget-hidden-section">
					<ul class="widget-color-list clearfix">
						<li style="background-color:#20232b;" data-color="widget-dark"></li>
						<li style="background-color:#4c5f70;" data-color="widget-dark-blue"></li>
						<li style="background-color:#23b7e5;" data-color="widget-blue"></li>
						<li style="background-color:#2baab1;" data-color="widget-green"></li>
						<li style="background-color:#edbc6c;" data-color="widget-yellow"></li>
						<li style="background-color:#fbc852;" data-color="widget-orange"></li>
						<li style="background-color:#e36159;" data-color="widget-red"></li>
						<li style="background-color:#7266ba;" data-color="widget-purple"></li>
						<li style="background-color:#f5f5f5;" data-color="widget-light-grey"></li>
						<li style="background-color:#fff;" data-color="reset"></li>
					</ul>
				</div>
				<div class="smart-widget-body">
					<form method="post" enctype="multipart/form-data">
						<div class="form-group">
							<label for="stu_name">学员名称</label>
							<input type="text" class="form-control" name="stu_name" id="stu_name" value="{{student.stu_name}}">
						</div><!-- /form-group -->

                      <div class="form-group">
							<label class="col-lg-2 control-label">选择教室</label>
							<div class="col-lg-10">
							  <select class="form-control" name="class_id">

							       {{#each(arr)}}

									    <option value="{{this.class_id}}" {{this.class_id===student.class_id?"selected":""}}>{{this.class_name}}</option>

								   {{/each}}
								   
							  </select>

							 </div><!-- /.col -->
						</div>

						 <div class="form-group">
							<label class="col-lg-2 control-label">选择老师</label>
							<div class="col-lg-10">
							  <select class="form-control" name="teach_id">

							       {{#each(trr)}}

									    <option value="{{this.teach_id}}" {{this.teach_id===student.teach_id?"selected":""}} >{{this.teach_name}}</option>

								   {{/each}}
							  </select>

							 </div><!-- /.col -->
						</div>
                        
                         <div class="form-group">
										<label class="col-lg-2 control-label">学员性别</label>
										<div class="col-lg-10">
											<div class="radio inline-block">
												<div class="custom-radio m-right-xs">
													<input type="radio" id="inlineRadio1" name="stu_sex" {{student.stu_sex==="1"?"checked":""}} value="1">
													<label for="inlineRadio1"></label>
												</div>
												<div class="inline-block vertical-top">男</div>
											</div>
											<div class="radio inline-block">
												<div class="custom-radio m-right-xs">
													<input type="radio" id="inlineRadio2" name="stu_sex" value="0" {{student.stu_sex==="1"?"":"checked"}}>
													<label for="inlineRadio2"></label>
												</div>
												<div class="inline-block vertical-top">女</div>
											</div>
										</div><!-- /.col -->
									</div>
								

                       
						 <div class="form-group">
							<label class="col-lg-2 control-label">选择课程</label>
							<div class="col-lg-10">
							  <select class="form-control" name="course_id" >

							       {{#each(crr)}}

									    <option value="{{this.course_id}}" {{{this.course_id===student.course_id?"selected":""}}}>

									    {{this.course_name}}</option>

								   {{/each}}


							  </select>

							 </div><!-- /.col -->
						</div>

						<div class="form-group">
							<label for="stu_date">出生日期</label>
							
							<input type="date" class="form-control" name="stu_date" id="stu_date" value="{{student.stu_date}}">
						</div><!-- /form-group -->


						

						<div class="form-group">
							<label for="stu_qq">学员QQ</label>
							<input type="text" class="form-control" name="stu_qq" id="stu_qq" value="{{student.stu_qq}}">
						</div><!-- /form-group -->

						<div class="form-group">
							<label for="stu_tel">学员电话</label>
							<input type="text" class="form-control" name="stu_tel" id="stu_tel" value="{{student.stu_tel}}">
						</div><!-- /form-group -->

						<div class="form-group">
							<label for="stu_cardName">学员证件</label>
							<input type="text" class="form-control" name="stu_cardName" id="stu_cardName" value="{{student.stu_cardName}}">
						</div><!-- /form-group -->

						<div class="form-group">
							<label for="stu_cardNum">证件号码</label>
							<input type="text" class="form-control" name="stu_cardNum" id="stu_cardNum" value="{{student.stu_cardNum}}">
						</div><!-- /form-group -->
						<div class="form-group">
							<label for="stu_address">学员住址</label>
							<input type="text" class="form-control" name="stu_address" id="stu_address" value="{{student.stu_address}}">
						</div><!-- /form-group -->
					
					   
					   <div class="form-group">
					

                        <label for="stu_img">上传文件</label>
							<input type="file" class="form-control" name="stu_img" id="stu_img" >

						</div>


						<div class="form-group">

							<label for="stu_time">添加时间</label>
							<input type="date" class="form-control" name="stu_time" id="stu_time" value="{{student.stu_time}}">

						</div><!-- /form-group -->


						<button type="submit" class="btn btn-success btn-sm">Submit</button>


					</form>
				</div>
			</div><!-- ./smart-widget-inner -->
		</div>

	</div>
</div>

{{/block}}
<!-- 转换时间格式 -->
<script>
	$(document).ready(function(){
	    var data_time = $(".data_time");

        data_time.each(function(item){
            var date = timestampToTime(this.dataset.time);
            this.innerHTML = "";
            this.innerHTML = date;
        });

        function timestampToTime(timestamp) {
            var date = new Date(timestamp * 1000);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
            Y = date.getFullYear() + '-';
            M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
            D = date.getDate() + ' ';
            h = date.getHours() + ':';
            m = date.getMinutes();
            return Y+M+D+h+m;
        }
	});
</script>